home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / update~4.z / update~4 / lib_stdio_stdio.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  1.5 KB  |  61 lines

  1. /*                s t d i o
  2.  *
  3.  * This provides a stream IO buffering scheme which is provides
  4.  * higher level IO functions over the lower level functions.
  5.  * A file associated with buffering is called a stream and is
  6.  * declared to be a pointer to the type FILE.
  7.  *
  8.  * Normally there are three open streams with pointers declared
  9.  * in <stdio.h>:
  10.  *
  11.  *    stdin    standard input file
  12.  *    stdout    standard output file
  13.  *    stderr    standard error file
  14.  *
  15.  * The constant NULL designates the non-existent pointer. The constant
  16.  * EOF is returned on eof and by many functions to designate an
  17.  * error condition.
  18.  *
  19.  * Any module which uses this package must include the header file
  20.  * at the beginning of the module:
  21.  *
  22.  *    #include <stdio.h>
  23.  *
  24.  * The following functions are implemented as macros:
  25.  *
  26.  *    getc
  27.  *    getchar
  28.  *    putc
  29.  *    putchar
  30.  *    feof
  31.  *    ferror
  32.  *    fileno
  33.  *    clearerr
  34.  *
  35.  * This file contains basic data structure declarations for the stdio
  36.  * package. Runtime cleanup is done by _ioflush.
  37.  *
  38.  * Patchlevel 1.1
  39.  *
  40.  * Edit History:
  41.  * 05-Sep-1989    Add _wrapstdio for cleaner system interface via
  42.  *        atexit().
  43.  */
  44.  
  45. #if    defined(MSDOS)
  46. #include <fcntl.h>
  47. #endif
  48.  
  49. #include "stdiolib.h"
  50.  
  51. static struct _iobuf _stdin  = {NULL, NULL, NULL, 0, _IOREAD,  0, 0};
  52. static struct _iobuf _stdout = {NULL, NULL, NULL, 0, _IOWRITE, 1, 0};
  53. static struct _iobuf _stderr = {NULL, NULL, NULL, 0, _IOWRITE, 2, 0};
  54.  
  55. struct _iobuf *_iop[_NFILE] = {&_stdin, &_stdout, &_stderr};
  56.  
  57. #if    defined(MSDOS)
  58. int _wrapstdio = 1;
  59. extern int _fmode = O_BINARY;
  60. #endif
  61.